package com.xu.demo1;

import java.util.Objects;

/**
 * @author xudenghui
 * @create 2021-08-31 15:02
 **/
public class OperationFactory {

    public static Operation CreateOperate(String operate){
        Operation operation =null;
        switch (operate){
            case "+":
                operation = new OperationAdd();
                break;
            case "-":
                operation =new OperationSub();
                break;
            case "*":
                operation = new OperationMul();
                break;
            case "/":
                operation = new OperationDiv();
                break;
        }
        return operation;
    }
}
